<?php
require_once("../db/db_connector.php");
require_once("../db/db_paradise.php");
require_once("../db/db_user.php");
require_once("../db/db_review.php");

// Database Access Begins ---------------------------------------- //
$con = get_db_con();
$paradise_list = get_paradise_list($con);
$user_list = get_user_list($con);
close_db_con();
// Database Access Ends ------------------------------------------ //

?>

<?php
include_once("../include/admin_header.php");
?>

<h2>Review Edit</h2>

<form action="review_edit_end.php" method="post">
	<table>
		<tr>
			<td><label for="content">content</label></td>
			<td><textarea id="content" name="content"></textarea></td>
		</tr>
		<tr>
			<td><label for="rating">rating</label></td>
			<td><input id="rating" name="rating" type="number" /></td>
		</tr>
		<tr>
			<td><label for="paradise_id">paradise_id</label></td>
			<td>
				<select id="paradise_id" name="paradise_id">
				<?php foreach ($paradise_list as $paradise) :?>
					<option value="<?=$paradise["id"]?>">
						<?=$paradise["id"].": ".$paradise["name"]?>
					</option>
				<?php endforeach ?>
				</select>
			</td>
		</tr>
		<tr>
			<td><label for="user_id">user_id</label></td>
			<td>
				<select id="user_id" name="user_id">
				<?php foreach ($user_list as $user) :?>
					<option value="<?=$user["id"]?>">
						<?=$user["id"].": ".$user["username"]?>
					</option>
				<?php endforeach ?>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="submit" />
			</td>
		</tr>
	</table>
</form>

<?php
include_once("../include/admin_footer.php");
?>
